<layout name="./Public/main_layout" />
 
<div class="page-header">

<h2><span class="glyphicon glyphicon-plus-sign glyphicon-head" aria-hidden="true"></span>添加角色 <small class="pull-right"><a href="" ng-click="changeRoute('/role')" ><span class="glyphicon glyphicon-list-alt glyphicon-head" aria-hidden="true"></span>角色管理</a></small></h2>
  
</div>
 
<form class="form-horizontal" name="CtrlForm" role="form" novalidate="novalidate" ng-submit="submit()" ng-controller='RoleAddCtrl' style="margin:0 auto;">
	<div class="form-group has-feedback">
	  <label for="name" class="col-md-3 control-label">角色名称</label>
	  <div class="col-md-6">
		<div class="input-group">
			<input type="text" class="form-control" id="name" name="name" placeholder="请输入角色名称" required ng-model='role.name' />
			<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true" ng-show="CtrlForm.name.$dirty && CtrlForm.name.$valid" style="margin-right:40px;"></span>
			<span class="input-group-addon" style="color:red;">必填</span>		
		</div>
	  </div>
	</div>
	
	<div class="form-group">
	  <label for="pid" class="col-md-3 control-label">角色分类</label>
	  <div class="col-md-6">	  
		<div class="input-group">
			<select class="form-control" id="pid" name="pid" ng-model='role.pid'>
				<option value="0">顶级分类</option>
				<option ng-repeat="item in data" value="{{item.id}}" ng-class="item.level|levelClass">{{'&nbsp;&nbsp;&nbsp;'|levelRepeat:item.level}}{{item.name}}</option>
			</select>
			<span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true" ng-show="CtrlForm.pid.$dirty && CtrlForm.pid.$valid" style="margin-right:70px;"></span>
			<span class="input-group-addon" style="color:red;">必填</span>		
		</div> <!-- /btn-group -->
	
	  </div>
	</div>

	<div class="form-group has-feedback">
	  <label for="status" class="col-md-3 control-label">状态</label>
	  <div class="col-md-6"  ng-init="role.status='1'">
		<label class="radio-inline">
		<input type="radio" value="1" name="status" ng-model='role.status'>启用</label>
		<label class="radio-inline">
		<input type="radio" value="" name="status" ng-model='role.status'>禁用</label>
	  </div>
	</div>	
	
	<div class="form-group has-feedback">
	  <label for="remark" class="col-md-3 control-label">备注</label>
	  <div class="col-md-6">
		<textarea class="form-control" rows="3" id="remark" name="remark" ng-model='role.remark'></textarea>
	  </div>
	</div>
	

   <div class="form-group has-feedback">
      <div class="col-md-offset-3 col-md-6">		
		<button type="reset" class="btn btn-default" ng-click="reset()">重置</button>		
        <button type="submit" class="btn btn-primary" ng-disabled="CtrlForm.$pristine || CtrlForm.$invalid">保存</button>
      </div>
   </div>
</form>